/** 
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
* 
* PmProjectChangeServiceAuto
* 项目基本信息变更申请
* 
* 修改纪录
* 2020-06-10 版本：1.0 liwanpeng 创建。
* @version 版本：1.0
* @author 作者：liwanpeng
* 创建日期：2020-06-10
*/

package com.topscomm.pm.service.impl.auto;

import com.topscomm.basic.IBasicDao;
import com.topscomm.pm.PmService;
import com.topscomm.pm.dao.IPmProjectChangeDao;
import com.topscomm.pm.pojo.PmProjectChangeEntity;
import com.topscomm.tap.common.DatacodeCache;

import javax.annotation.Resource;
import java.util.Map;


public class PmProjectChangeServiceAuto extends PmService<PmProjectChangeEntity,IPmProjectChangeDao> {
	
	/**
	 * @author: liwanpeng
	 * @date: 2020-06-10
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("projectid") != null) {
			temp = mapRow.get("projectid").toString();
			mapRow.put("dispprojectid", datacodeCache.getValueDynamic("PmProject", temp, "id", "name"));
		}
		if (mapRow.get("projectlevel") != null) {
			temp = mapRow.get("projectlevel").toString();
			mapRow.put("dispprojectlevel", datacodeCache.getValueDynamic("PmProjectLevel", temp, "code", "name"));
		}
		if (mapRow.get("projectlevel2") != null) {
			temp = mapRow.get("projectlevel2").toString();
			mapRow.put("dispprojectlevel2", datacodeCache.getValueDynamic("PmProjectLevel", temp, "code", "name"));
		}
		if (mapRow.get("category") != null) {
			temp = mapRow.get("category").toString();
			mapRow.put("dispcategory", datacodeCache.getValueDynamic("PmProjectCategory", temp, "code", "name"));
		}
		if (mapRow.get("category2") != null) {
			temp = mapRow.get("category2").toString();
			mapRow.put("dispcategory2", datacodeCache.getValueDynamic("PmProjectCategory", temp, "code", "name"));
		}
		if (mapRow.get("isincludeproducts") != null) {
			temp = mapRow.get("isincludeproducts").toString();
			mapRow.put("dispisincludeproducts", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("isincludeproducts2") != null) {
			temp = mapRow.get("isincludeproducts2").toString();
			mapRow.put("dispisincludeproducts2", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("ispurchase") != null) {
			temp = mapRow.get("ispurchase").toString();
			mapRow.put("dispispurchase", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("ispurchase2") != null) {
			temp = mapRow.get("ispurchase2").toString();
			mapRow.put("dispispurchase2", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_PmProject", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("province") != null) {
			temp = mapRow.get("province").toString();
			mapRow.put("dispprovince", datacodeCache.getValueDynamic("province", temp, "code", "name"));
		}
		if (mapRow.get("province2") != null) {
			temp = mapRow.get("province2").toString();
			mapRow.put("dispprovince2", datacodeCache.getValueDynamic("province", temp, "code", "name"));
		}
		if (mapRow.get("customercode") != null) {
			temp = mapRow.get("customercode").toString();
			mapRow.put("dispcustomercode", datacodeCache.getValueDynamic("PmCustomer", temp, "id", "name"));
		}
		if (mapRow.get("customercode2") != null) {
			temp = mapRow.get("customercode2").toString();
			mapRow.put("dispcustomercode2", datacodeCache.getValueDynamic("PmCustomer", temp, "id", "name"));
		}
	}

	@Override
	@Resource(name = "pmProjectChangeDao")
	public void setDao(IBasicDao<PmProjectChangeEntity> dao) {		
		super.setDao(dao);
	}
}
